package com.lzb.yabbs.util;

import android.content.Context;
import android.content.SharedPreferences;

/**
 * Created by liuzaibing on 2015/9/17.
 */
public class PersonalData {
    public static int getUserId(Context context){
        SharedPreferences sharedPreferences=context.getSharedPreferences("login",Context.MODE_PRIVATE);
        return sharedPreferences.getInt("uid",0);
    }
    public static String getToken(Context context){
        SharedPreferences sharedPreferences=context.getSharedPreferences("login",Context.MODE_PRIVATE);
        return sharedPreferences.getString("token", "");
    }
    public static boolean isLogin(Context context){
        SharedPreferences sharedPreferences=context.getSharedPreferences("login",Context.MODE_PRIVATE);
        return sharedPreferences.getBoolean("login", false);
    }
}
